package fun.codefarmer.pm.utils;

import fun.codefarmer.pm.model.Hr;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @ ClassName HrUtils
 * @ Descriotion TODO
 * @ author  codeFarmer_z
 * @ 公众号：码农教程
 * @ Date 2022/4/28 22:32
 **/
public class HrUtils {
    /**
     * 获取当前登录人的信息
     * @return
     */
    public static Hr getCurrentHr() {
        return ((Hr) SecurityContextHolder.getContext().getAuthentication().getPrincipal());
    }
}
